import 'package:flutter/material.dart';
import 'package:flutter_app/1_base/18_bottom_navigation.dart' as bottn;

class Register extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('注册'),),
      body: Center(
        child: TextButton(
          child: Text('注册成功'),
          onPressed: (){
            // Navigator.pop(context);
            // 将栈清空并将下一个元素入栈
            Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context){
              return bottn.NavigationBar(index: 2);
            }), (route) => route == null);
          },
        ),
      ),
    );
  }
}
